# Contributor: Jonah Brüchert <jbb@kaidan.im>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
maintainer="team/kde <bribbers@disroot.org>"
pkgname=angelfish
pkgver=24.08.2
pkgrel=0
pkgdesc="Small Webbrowser for Plasma Mobile"
# armhf blocked by extra-cmake-modules
# ppc64le, s390x, riscv64 and loongarch64 blocked by qt6-qtwebengine
arch="all !ppc64le !s390x !armhf !riscv64 !loongarch64"
url="https://phabricator.kde.org/source/plasma-angelfish/"
license="GPL-3.0-or-later"
depends="
	kirigami-addons
	kirigami
	purpose
	qt6-qtbase-sqlite
	"
makedepends="
	corrosion
	extra-cmake-modules
	futuresql-dev
	kdeclarative-dev
	ki18n-dev
	kio-dev
	kirigami-addons-dev
	kirigami-dev
	libplasma-dev
	purpose-dev
	qqc2-desktop-style-dev
	qt6-qtwebengine-dev
	samurai
	"
subpackages="$pkgname-lang"
_repo_url="https://invent.kde.org/network/angelfish.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/angelfish-$pkgver.tar.xz"
options="net" # net required to download Rust dependencies

provides="plasma-angelfish=$pkgver-r$pkgrel" # Backwards compatibility
replaces="plasma-angelfish"                  # Backwards compatibility

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure -j1
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
eec25fd2bef4fd8c074b5ca6c68ef8e65161489fea64f69743e27d6ed8397f6978a5b0c778191a5b68aaf5fd8c6925eab7f33fe4842cf58724aaa40adb79c8af  angelfish-24.08.2.tar.xz
"
